package com.xiaomi.service.impl;

import com.xiaomi.entity.ShopCar;
import com.xiaomi.mapper.ShopCarMapper;
import com.xiaomi.service.ShopCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * @ClassName ShopCarServiceImpl
 * @Description TODO
 * @Author WL
 * @Date 2021/11/27 16:12
 * @Version 1.0
 **/
@Service
public class ShopCarServiceImpl implements ShopCarService {
    @Autowired
    private ShopCarMapper shopCarMapper;

    @Override
    public List<ShopCar> listSearch(Integer userid) {
        return shopCarMapper.listSearch(userid);
    }

//    @Override
//    public Integer getCout() {
//        return shopCarMapper.getCout();
//    }

    @Override
    public void insert(String name, String iamg, BigDecimal priced, BigDecimal pricez, String guige, Integer quantity, Integer sku_id) {
        shopCarMapper.insert(name, iamg, priced, pricez, guige, quantity, sku_id);
    }

    @Override
    public void update(String guige, Integer quantity, Integer id) {
        shopCarMapper.update(guige, quantity, id);
    }

    @Override
    public void delete(Integer id) {
        shopCarMapper.delete(id);
    }
}
